(1) Field of the Invention
The present invention relates to a picture coding apparatus which codes a moving picture.
(2) Description of the Related Art
In recent years, there has been a transition in the recording medium for digital movie products, from tape recording media to Digital Versatile Disks (DVDs) and flash memories that have relatively small capacity. As such, in order to secure sufficient recording time, picture coding of higher compression rates, such as MPEG-2 and H.264, are being used.
FIG. 1 is an explanatory diagram showing the picture coding operation in MPEG-2, H.264, and so on. Here, a picture is one frame or one field of an inputted moving picture. In the coding in MPEG-2, H.264, and so on, in order to increase efficiency in coding, there is a function which refers to a picture other than the current picture to be coded, and codes the differential value between the current picture and the picture that is referred to. Here, a picture coded using only the data of the picture to be coded itself is called an I-picture; a picture coded by referring only to a picture that is inputted temporally ahead is called a P-picture, and a picture coded by referring to a picture that is inputted temporally ahead or after is called a B-picture. Note that in FIG. 1, these pictures are shown with “I” being affixed to an I-picture, “P” being affixed to a P-picture, and “B” being affixed to a B-picture. Furthermore, a B-picture refers to an I-picture or a P-picture immediately ahead in picture input order as well as an I-picture or a P-picture immediately after in input order.
In the case of coding a B-picture, since the temporally immediately subsequent I-picture or P-picture needs to be already coded, the order of the pictures to be coded is different from the order in which the pictures are inputted. (a) in FIG. 1 shows the order in which pictures are inputted; and (b) in FIG. 1 shows the order in which the pictures are coded. As in the figure, in order to code the first B-picture with input number 1, the preceding I-picture with input number 0 and the temporally subsequent P-picture with input number 3 need to be already coded. As such, after the coding of the first P-picture, the coding of an inputted picture is delayed by the time taken in rearranging the coding order.
Now, in MPEG-2, H.264, and so on, the data amount after the coding of each picture varies significantly according to the picture quality of the inputted picture. As such, in order to secure a certain amount of recording time, there is a need to control the data amount for each picture. In picture coding, in order to reduce the data amount after coding, a process is performed in which data accuracy is reduced by a data rounding-off process called quantization in the coding stage. However, when the accuracy in quantization is reduced significantly, the picture quality of the coded picture also deteriorates. As such, it is required that the quantization accuracy is increased and picture quality deterioration minimized as much as possible, within the required data amount.
Consequently, as a method of controlling the data amount, a method and a picture coding apparatus are being considered, in which all inputted pictures are coded once and, a coding condition for a quantization accuracy, and so on, which attains an optimal data amount is determined using the coding result, and coding is performed again using the result (see for example, Japanese Unexamined Patent Application Publication No. 8-18960).
However, in the picture coding apparatus in the aforementioned Patent Reference 1, since the data amount of coded picture data is optimized, there is the problem that circuit size and power consumption significantly increase.
In other words, in the picture coding apparatus in the aforementioned Patent Reference 1, since coding is performed in two iterations for all pictures, the size of the processing circuit needed for coding becomes twice that of normal, and the processing capacity for calculation needed for coding becomes twice that of normal. In addition, since the circuit size for normal coding is large, when that size is doubled, power consumption is also increased together with incurring a significant increase in cost.